<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('巷道口输送机列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>

                            <li>
                                <label>名称：</label>
                                <input type="text" name="name"/>
                            </li>

                            <li>
                                <label>设备状态：</label>
                                <input type="text" name="sbzt"/>
                            </li>
                            <li>
                                <label>任务号：</label>
                                <input type="text" name="rwh"/>
                            </li>

                            <li>
                                <label>巷道号：</label>
                                <input type="text" name="roadwayId"/>
                            </li>
                            <li>
                                <label>入出库标识：</label>
                                <select name="inOrOut" th:with="type=${@dict.getType('in_out_library')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>

                            <li>
                                <label>货位状态：</label>
                                <select name="status" th:with="type=${@dict.getType('space_status2')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>区域Id：</label>
                                <select name="areaId" th:with="type=${@dict.getType('area_id')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formId','bootstrap-table')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId','bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">

                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="device:msgXdkSsj:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>

                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="device:msgXdkSsj:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('device:msgXdkSsj:edit')}]];
        var removeFlag = [[${@permission.hasPermi('device:msgXdkSsj:remove')}]];
        var haveLjDatas = [[${@dict.getType('is_or_not')}]];
        var inOrOutDatas = [[${@dict.getType('in_out_library')}]];
        var haveSureDatas = [[${@dict.getType('have_sure')}]];
        var statusDatas = [[${@dict.getType('space_status')}]];
        var areaIdDatas = [[${@dict.getType('area_id')}]];
        var prefix = ctx + "device/msgXdkSsj";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "巷道口输送机",
                clickToSelect: true,//是否启用点击选中行
                uniqueId:"id",//表主键(用于修改和删除)
                sortName:"id",//必加排序 sortOrder: "asc"默认
                columns: [
                    {
                        halign: 'center',
                        align:'center',
                        checkbox: true
                    },
                {
                    title: "序号",
                    halign: 'center',
                    align:'center',
                    width: 55,
                    formatter:function (value, row, index) {
                        //获取每页显示的数量
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //获取当前是第几页
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //返回序号，注意index是从0开始的，所以要加上1
                        return pageSize * (pageNumber - 1) + index + 1;

                    }
                },

                {
                    field: 'location',
                    title: '位置',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'name',
                    title: '名称',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'dwbz',
                    title: '到位标识',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'kxbz',
                    title: '空闲标志',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'sbzt',
                    title: '设备状态',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'rwh',
                    title: '任务号',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'haveLj',
                    title: '是否有料架',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(haveLjDatas, value);
                    }
                },
                {
                    field: 'roadwayId',
                    title: '巷道号',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'inOrOut',
                    title: '入出库标识',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(inOrOutDatas, value);
                    }
                },
                {
                    field: 'haveSure',
                    title: '是否需要料架',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(haveSureDatas, value);
                    }
                },
                {
                    field: 'status',
                    title: '货位状态',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'areaId',
                    title: '区域Id',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(areaIdDatas, value);
                    }
                },

                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>